/**
 * 亿牛集团
 * 本源代码由亿牛集团及其作者共同所有，未经版权持有者的事先书面授权，
 * 不得使用、复制、修改、合并、发布、分发和/或销售本源代码的副本。
 *
 * @copyright Copyright (c) 2017 yiniu.com all rights reserved.
 */

package com.rico.simplejdbc.jdbc06.web;

import com.rico.simplejdbc.jdbc06.sdk.entities.AdClick;
import com.rico.simplejdbc.jdbc06.sdk.dao.AdClickDao;
import com.rico.simplejdbc.jdbc06.sdk.dao.SdkUserLogDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yaoyongfeng
 */
@RestController
public class UserController {
    @Autowired
    SdkUserLogDao sdkUserLogDao;
    @Autowired
    AdClickDao adClickDao;

    @GetMapping(path = "/click")
    @ResponseBody
    public List<AdClick> view() {

        List<AdClick> all = adClickDao.findAll();
        return all;
    }

    @GetMapping(path = "/test/{id}")
    @ResponseBody
    public String test(@PathVariable("id") Integer id) {
        return id.toString();
    }
}
